package com.jar.exercise.泛型.通配符;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public class test {
	public static void main(String[] args) {
//        List<? extends Father> list = new LinkedList<>();
//        list.add(new Son());
		List<? extends Father> list1 = new ArrayList<>();
		Father father = list1.get(0);//读取出来的东西只能存放在Father或它的基类里。
		Object object = list1.get(0);//读取出来的东西只能存放在Father或它的基类里。
		Human human = list1.get(0);//读取出来的东西只能存放在Father或它的基类里。
		Son son = (Son) list1.get(0);
	}
}

class Human {
}

class Father extends Human {

}

class Son extends Father {
}

class LeiFeng extends Father {
}